#ifndef __FREERTOS_CFG_H
#define __FREERTOS_CFG_H
#include "system_gd32f4xx.h"


#define configUSE_PREEMPTION                  1

#define configPRIO_BITS                       4
#define configLIBRARY_MAX_SYSCALL_INTERTUPT_PRIORITY  4
#define configMAX_SYSCALL_INTERRUPT_PRIORITY          (configLIBRARY_MAX_SYSCALL_INTERTUPT_PRIORITY<<(8-configPRIO_BITS))
#define configLIBRARY_LOWEST_INTERTUPT_PRIORITY       ((1<<configPRIO_BITS)-1)
#define configKERNEL_INTERRUPT_PRIORITY               (configLIBRARY_LOWEST_INTERTUPT_PRIORITY<<(8-configPRIO_BITS))               

#define configMAX_TASK_NAME_LEN               20
#define configSTACK_DEPTH_TYPE                uint32_t


#define configSYSTICK_CLOCK_HZ                SystemCoreClock
#define configTICK_RATE_HZ                    1000
#define configMAX_PRIORITIES                  20
#define configMINIMAL_STACK_SIZE              256
#define configTOTAL_HEAP_SIZE                 24*1024
#define configUSE_16_BIT_TICKS                0
#define configUSE_IDLE_HOOK                   0
#define configUSE_TICK_HOOK                   0
#define configSUPPORT_DYNAMIC_ALLOCATION      1

#define vPortSVCHandler		                    SVC_Handler
#define xPortPendSVHandler	                  PendSV_Handler
//#define xPortSysTickHandler                   SysTick_Handler


#define INCLUDE_vTaskDelay                    1                 
#define INCLUDE_vTaskDelayUntil               1
#define INCLUDE_xTaskGetCurrentTaskHandle     1
#endif

